// This source is subject to the Microsoft Public License.
// See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
// All other rights reserved.

// ******************************************************
// * ColumnListBoxExtender								*
// * http://ajaxcolumnlistbox.codeplex.com				*
// * Developed by Dan Pettersson, http://www.deap.nu	*
// ******************************************************

using System;
using System.Web.UI.WebControls;
using System.Web.UI;
using System.ComponentModel;
using System.ComponentModel.Design;
using AjaxControlToolkit;

[assembly: System.Web.UI.WebResource("ColumnListBox.ColumnListBoxBehavior.js", "text/javascript")]
[assembly: WebResource("ColumnListBox.ColumnListBox.css", "text/css", PerformSubstitution = true)]

namespace ColumnListBox
{
	[Designer(typeof(ColumnListBoxDesigner))]
	[ClientScriptResource("ColumnListBox.ColumnListBoxBehavior", "ColumnListBox.ColumnListBoxBehavior.js")]
	[ClientCssResource("ColumnListBox.ColumnListBox.css")]
	[TargetControlType(typeof(ListBox))]
	[DefaultProperty("Columns")]
	public class ColumnListBoxExtender : ExtenderControlBase
	{
		// TODO: Add your property accessors here.
		//
		[ExtenderControlProperty]
		public int Columns
		{
			get
			{
				return GetPropertyValue("Columns", 2);
			}
			set
			{
				SetPropertyValue("Columns", value); 
			}
		}

		[ExtenderControlProperty]
		public bool Resizable
		{
			get
			{
				return GetPropertyValue<bool>("Resizable", false);
			}
			set
			{
				SetPropertyValue("Resizable", value);
			}
		}

		[ExtenderControlProperty]
		public string CssClass
		{
			get
			{
				return GetPropertyValue("CssClass", "__ajax_columnlistbox");
			}
			set
			{
				SetPropertyValue("CssClass", value);
			}
		}
	}
}
